import XYZ from "ol/source/XYZ";
import Tile from "ol/layer/Tile";
import { Vector as VectorLayer } from "ol/layer";
import { Vector as VectorSource } from "ol/source";
import { tianditu } from "./config/index";
export default class tdtLayer {
	constructor() {
		return [
			new Tile({
				pId: "tiandituVecLayer",
				source: new XYZ({
					url: tianditu.vec_w,
					crossOrigin: "anonymous",
				}),
				visible: true,
			}),
			new Tile({
				pId: "tiandituVecLayer",
				source: new XYZ({
					url: tianditu.cva_w,
					crossOrigin: "anonymous",
				}),
				visible: true,
			}),
			new Tile({
				pId: "tiandituImgLayer",
				source: new XYZ({
					url: tianditu.img_w,
					crossOrigin: "anonymous",
				}),
				visible: false,
			}),
			new Tile({
				pId: "tiandituImgLayer",
				source: new XYZ({
					url: tianditu.cia_w,
					crossOrigin: "anonymous",
				}),
				visible: false,
			}),
			new Tile({
				pId: "tiandituCesuimLayer",
				source: new XYZ({
					url: tianditu.cesuim_layer,
					crossOrigin: "anonymous",
				}),
				visible: false,
			}),
			new Tile({
				pId: "tiandituCesuimLayer",
				source: new XYZ({
					url: tianditu.cesuim_name,
					crossOrigin: "anonymous",
				}),
				visible: false,
			}),
			new VectorLayer({
				source: new VectorSource(),
			}),
		];
	}
}
